package D1203_02;

import java.util.Scanner;

public class Exam1 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String  str=sc.next();
        int count=0;
        for (int i=0;i<str.length();i++){
            if(str.charAt(i)=='a'){
                count++;
            }

        }
        System.out.println(count);
    }
}
